import {arrAttrFind}  from '@/util/format/array.js'

const withdrawStatus = (key) => {
	const list = [
		{
			name:'等待审核',
			value:1,
		},
		{
			name:'审核失败',
			value:2,
		},{
			name:'已打款',
			value:3,
		}
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
//商家状态
const mchStatus = (key) => {
	let list = [
		{
			name:'等待审核',
			value:1,
		},
		{
			name:'审核失败',
			value:2,
		},
		{
			name:'审核通过',
			value:3,
		},
		{
			name:'禁用',
			value:4,
		}
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}

const imgLoad = ""
const payType = (key) =>{
	let list = [
		{
			name:'商城下单',
			value:'goods_order',
		}
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
const spikeTimeType = (key) =>{
	let list = [
		{
			name:'一次性',
			value:1,
		},{
			name:'每天',
			value:2,
		},
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
const upOrDown = (key) =>{
	let list = [
		{
			name:'增加',
			value:1,
		},{
			name:'减少',
			value:2,
		},
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
const couponType = (key) =>{
	let list = [
		{
			name:'直减',
			value:1,
		},{
			name:'打折',
			value:2,
		},
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
const orderStatus = (key) =>{
	let list = [
		{
			name:'待付款',
			value:3,
		},{
			name:'待发货',
			value:4,
		},{
			name:'待收货',
			value:5,
		},{
			name:'待评价',
			value:6,
		},{
			name:'已完成',
			value:7,
		},{
			name:'退款/售后',
			value:8,
		},{
			name:'已关闭',
			value:9,
		},
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
const orderType = (key) =>{
	let list = [
		{
			name:'商品订单',
			value:1,
		},{
			name:'积分兑换订单',
			value:2,
		},{
			name:'秒杀订单',
			value:3,
		},{
			name:'拼团订单',
			value:4,
		},
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
const yesOrNo = (key) =>{
	let list = [
		{
			name:'是',
			value:1,
		},{
			name:'否',
			value:0,
		},
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
const couponStatus = (key) =>{
	let list = [
		{
			name:'待使用',
			value:4,
		},{
			name:'已使用',
			value:5,
		},{
			name:'已过期',
			value:6,
		},
	]
	if(key){
		return arrAttrFind(list,'value',key,'name')
	}
	return list
}
const addr_line_img =  ``
export default {
	withdrawStatus,
	payType,
	mchStatus,
	spikeTimeType,
	upOrDown,
	couponType,
	orderStatus,
	orderType,
	yesOrNo,
	couponStatus,
	addr_line_img,
	imgLoad,
}
